extends Node2D

@onready var camera : Camera2D = $Camera2D

func _ready() -> void:
	EventBus.player_changed_room.connect(move_camera)

func move_camera(new_position : Vector2) -> void:
	camera.position = new_position

func _unhandled_key_input(event: InputEvent) -> void:
	var key = (event as InputEventKey).keycode
	if  key == KEY_R:
		SceneManager.change_to_scene("CURRENT")
	elif key == KEY_B:
		SceneManager.change_to_scene(SceneManager.level_select)

